import React, { Component } from 'react'
import { HashRouter as Router, Redirect, Route, Switch } from 'react-router-dom'
import Home from '../Home/Home'
import Category from '../Category/Category'
import Cart from '../Cart/Cart'
import My from '../My/My'
import Tabbar from '../Tabbar/Tabbar'
import SearchCenter from '../SearchCenter/SearchCenter'
import GoodDetail from '../GoodDetail/GoodDetail'
import ProductList from '../ProductList/ProductList'
export default class PrivateRouter extends Component {
  render() {
    return (
      <div>
        <Router>
          <Switch>
            <Route exact path="/home" render={(props) => <Tabbar {...props}> <Home></Home></Tabbar> }></Route>
            <Route exact path="/category" render={(props) => <Tabbar {...props}><Category></Category></Tabbar>}></Route>
            <Route exact path="/cart" render={(props) => <Tabbar {...props}><Cart></Cart></Tabbar>}></Route>
            <Route exact path="/my" render={(props) => <Tabbar {...props}> <My></My></Tabbar>}></Route>
            <Route exact path="/searchCenter" render={(props) => <SearchCenter></SearchCenter>}></Route>
            <Route exact path="/goodDetail" render={(props) =>  <GoodDetail {...props}></GoodDetail>}></Route>
            <Route exact path="/productList" render={(props) =>  <ProductList></ProductList>}></Route>
            <Redirect to="/home"></Redirect>
          </Switch>
        </Router>
      </div>
    )
  }
}
